package com.example.backend;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 工单反馈系统后端应用
 * 
 * 主要功能：
 * - 用户管理和权限控制
 * - 工单创建、分配、处理
 * - 文件上传下载
 * - 通知系统
 * - 数据统计和报表
 * 
 * 性能优化特性：
 * - 多级缓存策略
 * - 数据库连接池优化
 * - 异步处理
 * - 性能监控
 * - 安全防护
 */
@SpringBootApplication
@EnableCaching
@EnableAsync
@EnableScheduling
@EnableTransactionManagement
public class BackEndApplication {

    public static void main(String[] args) {
        // 设置系统属性以优化性能
        System.setProperty("spring.jmx.enabled", "false");
        System.setProperty("spring.main.lazy-initialization", "false");
        
        SpringApplication app = new SpringApplication(BackEndApplication.class);
        
        // 优化启动性能
        app.setLazyInitialization(false);
        app.setRegisterShutdownHook(true);
        
        app.run(args);
        
        System.out.println("==========================================");
        System.out.println("工单反馈系统后端服务启动成功！");
        System.out.println("API文档地址: http://localhost:9090/swagger-ui.html");
        System.out.println("健康检查: http://localhost:9090/actuator/health");
        System.out.println("==========================================");
    }
}
